package demo2;

import javafx.print.Printer;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-08
 * Time: 12:30
 */
public class TestDemo4 {

    public static void main(String[] args) {
//         try(OutputStream outputStream = new FileOutputStream("text.txt")){
//             outputStream.write('j');
//             outputStream.write('a');
//             outputStream.write('v');
//             outputStream.write('a');
//         }catch(IOException e){
//             e.printStackTrace();
//         }
         try(OutputStream outputStream = new FileOutputStream("text.txt")){
             PrintWriter printWriter = new PrintWriter(outputStream);
             printWriter.println("hello");
         }catch(IOException e){
             e.printStackTrace();
         }
    }


}
